package com.budwk.app.miniapp.models;

import com.budwk.starter.common.openapi.annotation.ApiModel;
import com.budwk.starter.common.openapi.annotation.ApiModelProperty;
import com.budwk.starter.database.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
import java.time.LocalDateTime;

/**
 * @author wizzer(wizzer.cn) on 2016/7/2.
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Table("wx_msg")
@ApiModel(description = "微信消息表")
public class WxMsg extends BaseModel implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@Column
	@Name
	@Comment("ID")
	@ApiModelProperty(description = "ID")
	@ColDefine(type = ColType.VARCHAR, width = 32)
	@PrevInsert(els = {@EL("uuid()")})
	private String id;

	/**
	 * 创建者
	 */
	@Column("create_id")
	@Comment("创建者")
	@ApiModelProperty(description = "创建者")
	@ColDefine(type = ColType.VARCHAR, width = 32)
	private String createId;

	/**
	 * 创建时间
	 */
	@Column("create_time")
	@Comment("创建时间")
	@ApiModelProperty(description = "创建时间")
	@ColDefine(type = ColType.TIMESTAMP, width = 6)
	private LocalDateTime createTime;

	/**
	 * 更新者
	 */
	@Column("update_id")
	@Comment("更新者")
	@ApiModelProperty(description = "更新者")
	@ColDefine(type = ColType.VARCHAR, width = 32)
	private String updateId;

	/**
	 * 更换时间
	 */
	@Column("update_time")
	@Comment("更换时间")
	@ApiModelProperty(description = "更换时间")
	@ColDefine(type = ColType.TIMESTAMP, width = 6)
	private LocalDateTime updateTime;

	/**
	 * 备注
	 */
	@Column
	@Comment("备注")
	@ApiModelProperty(description = "备注")
	@ColDefine(type = ColType.VARCHAR, width = 100)
	private String remark;

	/**
	 * 公众号名称
	 */
	@Column("app_name")
	@Comment("公众号名称")
	@ApiModelProperty(description = "公众号名称")
	@ColDefine(type = ColType.VARCHAR, width = 50)
	private Boolean appName;

	/**
	 * 公众号logo
	 */
	@Column("app_logo")
	@Comment("公众号logo")
	@ApiModelProperty(description = "公众号logo")
	@ColDefine(type = ColType.VARCHAR, width = 500)
	private String appLogo;

	/**
	 * 微信用户ID
	 */
	@Column("wx_user_id")
	@Comment("微信用户ID")
	@ApiModelProperty(description = "微信用户ID")
	@ColDefine(type = ColType.VARCHAR, width = 32)
	private String wxUserId;

	/**
	 * 微信用户昵称
	 */
	@Column("nick_name")
	@Comment("微信用户昵称")
	@ApiModelProperty(description = "微信用户昵称")
	@ColDefine(type = ColType.VARCHAR, width = 200)
	private String nickName;

	/**
	 * 微信用户头像
	 */
	@Column("headimg_url")
	@Comment("微信用户头像")
	@ApiModelProperty(description = "微信用户头像")
	@ColDefine(type = ColType.VARCHAR, width = 1000)
	private String headimgUrl;

	/**
	 * 消息分类（1、用户发给公众号；2、公众号发给用户；）
	 */
	@Column
	@Comment("消息分类（1、用户发给公众号；2、公众号发给用户；）")
	@ApiModelProperty(description = "消息分类（1、用户发给公众号；2、公众号发给用户；）")
	@ColDefine(type = ColType.CHAR, width = 2)
	private String type;

	/**
	 * 消息类型（text：文本；image：图片；voice：语音；video：视频；shortvideo：小视频；location：地理位置；music：音乐；news：图文；event：推送事件）
	 */
	@Column("rep_type")
	@Comment("消息类型（text：文本；image：图片；voice：语音；video：视频；shortvideo：小视频；location：地理位置；music：音乐；news：图文；event：推送事件）")
	@ApiModelProperty(description = "消息类型（text：文本；image：图片；voice：语音；video：视频；shortvideo：小视频；location：地理位置；music：音乐；news：图文；event：推送事件））")
	@ColDefine(type = ColType.CHAR, width = 20)
	private String repType;

	/**
	 * 事件类型（subscribe：关注；unsubscribe：取关；CLICK、VIEW：菜单事件）
	 */
	@Column("rep_event")
	@Comment("事件类型（subscribe：关注；unsubscribe：取关；CLICK、VIEW：菜单事件）")
	@ApiModelProperty(description = "事件类型（subscribe：关注；unsubscribe：取关；CLICK、VIEW：菜单事件）")
	@ColDefine(type = ColType.CHAR, width = 20)
	private String repEvent;

	/**
	 * 回复类型文本保存文字、地理位置信息
	 */
	@Column("rep_content")
	@Comment("回复类型文本保存文字、地理位置信息")
	@ApiModelProperty(description = "回复类型文本保存文字、地理位置信息")
	@ColDefine(type = ColType.TEXT)
	private String repContent;

	/**
	 * 回复类型imge、voice、news、video的mediaID或音乐缩略图的媒体id
	 */
	@Column("rep_media_id")
	@Comment("回复类型imge、voice、news、video的mediaID或音乐缩略图的媒体id")
	@ApiModelProperty(description = "回复类型imge、voice、news、video的mediaID或音乐缩略图的媒体id")
	@ColDefine(type = ColType.VARCHAR, width = 64)
	private String repMediaId;

	/**
	 * 回复的素材名、视频和音乐的标题
	 */
	@Column("rep_name")
	@Comment("回复的素材名、视频和音乐的标题")
	@ApiModelProperty(description = "回复的素材名、视频和音乐的标题")
	@ColDefine(type = ColType.VARCHAR, width = 64)
	private String repName;

	/**
	 * 回复的素材名、视频和音乐的标题
	 */
	@Column("rep_desc")
	@Comment("视频和音乐的描述")
	@ApiModelProperty(description = "视频和音乐的描述")
	@ColDefine(type = ColType.VARCHAR, width = 200)
	private String repDesc;

	/**
	 * 链接
	 */
	@Column("rep_url")
	@Comment("链接")
	@ApiModelProperty(description = "链接")
	@ColDefine(type = ColType.VARCHAR, width = 500)
	private String repUrl;

	/**
	 * 高质量链接
	 */
	@Column("rep_hq_url")
	@Comment("高质量链接")
	@ApiModelProperty(description = "高质量链接")
	@ColDefine(type = ColType.VARCHAR, width = 500)
	private String repHqUrl;

	/**
	 * 图文消息的内容
	 */
	@Column
	@Comment("图文消息的内容")
	@ApiModelProperty(description = "图文消息的内容")
	@ColDefine(type = ColType.TEXT)
	private String content;

	/**
	 * 缩略图的媒体id
	 */
	@Column("rep_thumb_media_id")
	@Comment("缩略图的媒体id")
	@ApiModelProperty(description = "缩略图的媒体id")
	@ColDefine(type = ColType.VARCHAR, width = 64)
	private String repThumbMediaId;

	/**
	 * 缩略图url
	 */
	@Column("rep_thumb_url")
	@Comment("缩略图url")
	@ApiModelProperty(description = "缩略图url")
	@ColDefine(type = ColType.VARCHAR, width = 500)
	private String repThumbUrl;

	/**
	 * 地理位置维度
	 */
	@Column("rep_location_x")
	@Comment("地理位置维度")
	@ApiModelProperty(description = "地理位置维度")
	@ColDefine(type = ColType.FLOAT, width = 53)
	private String repLocationX;

	/**
	 * 地理位置经度
	 */
	@Column("rep_location_y")
	@Comment("地理位置经度")
	@ApiModelProperty(description = "地理位置经度")
	@ColDefine(type = ColType.FLOAT, width = 53)
	private String repLocationY;

	/**
	 * 地图缩放大小
	 */
	@Column("rep_scale")
	@Comment("地图缩放大小")
	@ApiModelProperty(description = "地图缩放大小")
	@ColDefine(type = ColType.FLOAT, width = 53)
	private String repScale;

	/**
	 * 已读标记（1：是；0：否）
	 */
	@Column("read_flag")
	@Comment("已读标记（1：是；0：否）")
	@ApiModelProperty(description = "已读标记（1：是；0：否）")
	@ColDefine(type = ColType.CHAR, width = 2)
	private String readFlag;

	/**
	 * 数量
	 */
	private Integer countMsg;

	/**
	 * repType not in筛选
	 */
	private String notInRepType;

}
